<template>
  <div>
    <van-cell
      title="朝  向"
      @click="isShowHouseDirection = true"
      :value="oriented ? oriented.label:'请选择'"
      is-link
    />
    <van-popup
      v-model="isShowHouseDirection"
      position="bottom"
      :style="{ height: '40%' }"
    >
      <van-picker
        show-toolbar
        :columns="row"
        value-key="label"
        @confirm="onConfirm"
        @cancel="isShowHouseDirection = false"
      />
    </van-popup>
  </div>
</template>

<script>
export default {
  name: 'direction',
  props: {
    row: {
      type: Array,
      required: true
    }
  },
  data () {
    return {
      isShowHouseDirection: false,
      oriented: ''
    }
  },

  created () {},

  methods: {
    onConfirm (val) {
      console.log(val.value)
      this.oriented = val
      this.$emit('getOriented', this.oriented)
      this.isShowHouseDirection = false
    }
  }
}
</script>

<style scoped lang="less"></style>
